#ifndef BUSINESSLISTPAGE_H
#define BUSINESSLISTPAGE_H

#include "header.h"
#include "database.h"

class BusinessListPage : public QWidget
{
    Q_OBJECT

public:
    explicit BusinessListPage(database &db, QWidget *parent = nullptr);
    ~BusinessListPage();

    // 加载商户列表
    bool loadBusinessList();

public slots:
    void refresh();

signals:
    void businessSelected(int businessId, const QString &businessName);

private:
    database &db;
    QTableWidget *businessTable;

    // 商户点击处理
    void onBusinessClicked(int row);

protected:
    bool eventFilter(QObject *obj, QEvent *event) override;
};

#endif // BUSINESSLISTPAGE_H 